<?php

	if ($this->getParent()->results)
	{
		foreach ($this->getParent()->results as $result)
		{
			if (!isset($result->value))
				$result->value = $result->caption;
			else if (!isset($result->caption))
				$result->caption = $result->value;
			
			if (isset($result->disabled) && ($result->disabled))
				$disabled = true;
			else 
				$disabled = false;
				
			if (isset($result->link))
			{
				$tag = "a";
				$extra = "href='{$result->link}'";
				$class = "___ax ";
			}
			else 
			{
				$tag = "div";
				$class = "";
				$extra = "";
			}
			
			echo "<{$tag} $extra class='{$class}qSearchTextResultsItem".($disabled ? " qSearchTextResultsItemDisabled" : "").
				"'><div class='qSearchTextResultsItemValue'>{$result->value}</div><div class='qSearchTextResultsItemCaption'>".
				"{$result->caption}</div></{$tag}>";
		}
	}

?>